% -*- TeX -*- -*- ENG -*- -*- UNIX -*-

% Defining Document Class

\documentclass[a4paper, % DIN A4 Format
11pt, %Font size
twoside, % Write on both sides of a page
openany, % New chapters can be started on any side (left side or right side), alternative openright
cleardoublepage=plain, % new pages will have page numbers written alternative cleardoublepage=empty (no page numbers)
numbers=noenddot, % no end dot after the page number
%appendixprefix, % in annex chapters use a prefix like eg "Appendix A"
BCOR1.5cm, % The binding correction
bibliography=totoc % bibliography displayed in the table of contents 
%idxtotoc % Index table of contents 
]{scrreprt} % Alternatives are: scrartcl, scrreprt, scrbook

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% Defining Constants

\def\ausarbeitungsTypBachelor{Bachelor}
\def\ausarbeitungsTypMaster{Master}
\def\ausarbeitungsTypDiplom{Diplom}
\def\ausarbeitungsTypSeminar{Seminar}
\def\ausarbeitungsTypProSeminar{Pro-Seminar}

\def\bachelorArbeit{Bachelor's Thesis}
\def\masterArbeit{Master's Thesis}
\def\diplomArbeit{Diploma Thesis}
\def\seminarArbeit{Seminar Thesis}

\def\gradBachelor{Bachelor of Science}
\def\gradMaster{Master of Science}
\def\gradDiplom{Diplom-Informatiker}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% My Data like name,address date etc to be printed in the first page of the document

% The following instruction defines the type of thesis or report, the following arguments are allowed:
% \ausarbeitungsTypBachelor		Bachelor's thesis
% \ausarbeitungsTypMaster			Master's thesis
% \ausarbeitungsTypDiplom			Diploma thesis
% \ausarbeitungsTypSeminar		Seminar report (Master's program)
% \ausarbeitungsTypProSeminar	Pro-Seminar report (Bachelor's program)
\def\ausarbeitungsTyp{\ausarbeitungsTypSeminar}

\def\meinErstellungsdatum{July 2014} % day of completion, e.g. May 2009
\def\meinTitel{Leakage Free Authentication of Trees} % your title
\def\meinName{Sourav Saraf} % your name
\def\meineName{Hussain Abid Syed} % your name
\def\meineStrasseHausNr{Detmolder Street 108} % street and house number
\def\meinePLZundOrt{33175 Bad Lippspringe} % zip code and city
\def\meinErstgutachter{Prof. Christian Scheideler} % first supervisor, applies to seminars, too
\def\meinZweitgutachter{Robert Gmyr} % second supervisor, irrelevant for seminars
\def\meinePDFStichwoerter{Template, technical articles, thesis, seminar} % key words

\def\titelDesSeminars{Leakage Free Authentication of Trees} % seminar topic, apllies to seminars only


% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% All packages to be imported here

\usepackage[american]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amssymb,amsmath,mathtools}
%\usepackage{graphicx}
%\usepackage[automark]{scrpage2} % use automatic markings of headers and footers
\usepackage{ifthen} % 
\usepackage{graphics} % Package to include graphics
\usepackage{epstopdf} % Package to include eps diagrams to pdf format for rendering
\usepackage{verbatim}  % package for comment environment
%\usepackage{natbib}    % for BibTeX with DINAT style (DIN 1505, Parts 2 and 3)
%\usepackage{bibgerm}   % for BibTeX with German style, for example, geralpha
%\usepackage{makeidx}   % 
%\makeindex             %
%\usepackage{epsfig}   % for pasting EPS graphics
\usepackage{array}     % help for using tables
\usepackage{float}    % for further Floats except table and figure
\usepackage{setspace}  % sets linespacing to 1-fold, 1.5-fold or 2 fold
\usepackage{enumitem}
\usepackage{listings}
\usepackage{mathtools}
\usepackage{etoolbox}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% newcommand / newtheorem (This command "\newtheorem" will help to create frequently used constructs in mathematics)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newenvironment{proof}{\noindent {\bf Proof.}\ }{$\quad\square$\par\vskip 4mm\par}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% Some auxiliary mathematical constructs and simplifications like defining "\abs" for modulus, "\ceil" for ceiling function

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{bbm}

\newcommand{\IN}{\mathbbm{N}}           % Natural Numbers
\newcommand{\IZ}{\mathbbm{Z}}           % Integers
\newcommand{\IQ}{\mathbbm{Q}}           % Rational Numbers
\newcommand{\IR}{\mathbbm{R}}           % Real Numbers
\newcommand{\IC}{\mathbbm{C}}           % Complex Numbers
\newcommand{\IP}{\mathbbm{P}}           % Prime Numbers

\newcommand{\set}[1]{\left\{ #1 \right\}}               % Set
\newcommand{\powerset}[1]{\wp\!\left(#1\right)}         % Power Set
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}       % Absolute
\newcommand{\norm}[1]{\left\lVert #1 \right\rVert}      % Norm
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}   % floor
\newcommand{\ceil}[1]{\left\lceil #1 \right\rceil}      % ceiling

\newcommand{\signatur}[3]{#1:#2\,\rightarrow\,#3}     %Function Signature

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% Page Layouts, for example, Header and Footer definition

\usepackage{fancyhdr} % package helps in creating fancy headers
\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}
\pagestyle{fancy}
%\pagestyle{plain} % page number location 'above', 'footer', 'empty', 'plain' possible. plain means just enter page numbers
%\addtolength{\headwidth}{\marginparsep}
%\addtolength{\headwidth}{\marginparwidth}
%\addtolength{\headwidth}{3cm}
\renewcommand{\chaptermark}[1]{\markboth{\sc\thechapter. #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\sl\thesection~#1}}
\lhead[\fancyplain{}{\leftmark}]{}
\rhead[]{\fancyplain{}{\rightmark}}
\lfoot[\fancyplain{\bf\thepage}{\bf\thepage}]{}
\rfoot[]{\fancyplain{\bf\thepage}{\bf\thepage}}
\cfoot[]{}

\fancypagestyle{plain}{% Redefining the plain pages
	\fancyhf{}
	\fancyfoot[LE,RO]{\textbf{\thepage}}
	\renewcommand{\headrulewidth}{0pt}
	\renewcommand{\footrulewidth}{0pt}
}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% The contents in the next 3 lines is only written to remove pagebreaks between chapters

\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother

\renewcommand*{\chapterheadstartvskip}{\vspace*{0.5cm}}
\renewcommand*{\chapterheadendvskip}{\vspace{0.5cm}}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% Check to ensure that we execute pdflatex (Koma classes work only with pdflatex)

\ifpdfoutput
{
% PDF is being used
	
  \usepackage[pdftex]{graphicx,color}
  
  % Color for links
  
  %\definecolor{myLinkColor}{rgb}{0,0,.5}
  %\definecolor{myCiteColor}{rgb}{0,.5,0}
  %\definecolor{myFileColor}{rgb}{.5,0,0}
  %\definecolor{myURLColor}{rgb}{0,0,1}
  % Setzen aller Link-Farben auf Schwarz
  \definecolor{myLinkColor}{rgb}{0,0,0}
  \definecolor{myCiteColor}{rgb}{0,0,0}
  \definecolor{myFileColor}{rgb}{0,0,0}
  \definecolor{myURLColor}{rgb}{0,0,0}
  \usepackage[pdftex,%
  						pdftitle={\meinTitel}, %
  						pdfauthor={\meinName}, %
  						pdfkeywords={\meinePDFStichwoerter},
  						plainpages=false, %
  						pdfpagelabels, %
  						colorlinks=true, %
  						linkcolor=myLinkColor, %
  						citecolor=myCiteColor, %
  						filecolor=myFileColor, %
  						urlcolor=myURLColor, %
  						bookmarks, % 
  						bookmarksnumbered, %
  						breaklinks, %
  						%pdfpagelayout={TwoColumnRight}%
  						]{hyperref}
  \pdfcompresslevel=9 % Compression level for Text und Graphics
  \DeclareGraphicsExtensions{.pdf, .png, .jpg, .tif, .mps} % {DeclareGraphicsExtensions. Pdf,. Png,. Jpg,. Tif,. Mps}% File extensions for graphic files, sorted by priority, automatic selection of the correct file extension if not specified
}
{
% Not a PDF
  
  \usepackage{graphicx}
  \usepackage{color}
  \usepackage[hypertex, bookmarks,% 
  						bookmarksnumbered, % 
  						breaklinks, % 
  						]{hyperref}
  \DeclareGraphicsExtensions{.eps,.ps} 
}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% The file included below that is "DocumentStructure.tex" is responsible for all major formatting of the document. Thus it is not advisable to change that.
% It references the files myHyphenation.tex and myDocumentStructure.tex. Here the file myDocumentStructure.tex is responsible for the content of your document.
%
% Thus to compile successfully we need the files "this file", "DocumentStructure.tex", myHyphenation.tex, myDocumentStructure.tex and all the references made in the file myDocumentStructure.tex.

\input{DocumentStructure} % The actual content and the structure of the document

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %